#include <cfg_init.h>
#include <dma.h>
#include <gpio.h>
#include <i2c.h>
#include <spi.h>
#include <usart.h>
#include "sys_log.h"
#include <task.h>
#include "hal_init.h"
#include "hal_tlv.h"
#include "cfg_param.h"

static void task_config_init();

void task_main()
{
    task_config_init();

#if MODEL_CHOICE == MODEL_LASER_DFB || MODEL_CHOICE == MODEL_LASER_TA
    task_laser();
#elif MODEL_CHOICE == MODEL_MOTOR
    task_motor();
#endif
}

static void task_config_init()
{
    hal_init();
    SLOG_I("lasermotor hal_init sucess \t\r\n");

    hal_uart_init();
    SLOG_I("lasermotor hal_uart_init sucess \t\r\n");

    hal_globeconfig_Init();

#ifdef BIN_MODE_OPEN
    if (hal_deviceid_Init())
    {
        SLOG_I("lasermotor hal_deviceid_Init flash id checksum error \t\r\n");
    }
#endif

}
